<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="{{ URL::asset('/') }}big/css/style.css"/>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="{{ URL::asset('/') }}big/js/echarts.js"></script>
<script src="{{ URL::asset('/') }}big/js/hubei.js"></script>
<style type="text/css">
	.tb_box>div { position:relative;z-index:6}
	.tk {height: 135px;width: 300px;background-color: rgba(0, 31, 78, 0.75);border: 1px solid #3398db;}
	.tk .tishi {color:#fff;padding: 10px 0 0 15px;font-size: 14px;}
	.tk .table {}
	.tk .table .close {padding: 5px 15px;background: none;border: 1px solid #82cefa;position: absolute;right: 10px;bottom: 10px;cursor: pointer;
						color: #fff;}
	.tk .table .close:hover {background: #4cebf7;}
	.tk .tk_tit {width: 290px;margin-top: -3px;}
	.mjbtn{
		position: absolute;
	    top: 40px;
	    left: 90px;
	    border-radius: 5px;
	    padding: 5px;
	    background: none;
	    border: 1px solid #63d0fd;
	    color: #fff;
	    cursor: pointer;
	    z-index: 99;
	}
</style>
</head>
<body>
	<div class="main">
		<a href="http://nb.yntosite.com/admin/big/index2" class="mjbtn">民警综合信息</a>
		 <div class="main_title">
		 	<h1>公安内保综合信息管理平台</h1>
		 	<div class="time_box">
				<p class="right_time" id="now_time">现在是：北京时间：<span id="hours">11:08:29</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="year">2017年8月11日</span>&nbsp;&nbsp;&nbsp;<span id="today">星期五</span></p>
			</div>
		 </div>
		 <div class="map_box" >
		 	<!--<h3>地图</h3>-->
		 	<button id="back">返回</button>
		 	<div id="allmap" style="width: 850px;height: 600px;"></div>
		 </div>
		 <div class="tb_box box_1">
		 	<h3>单位数量统计</h3>
		 	<div id="shul" style="height: 265px;"></div>
		 	<span class="kk1"></span>
		 	<span class="kk2"></span>
		 </div>
		  <div class="tb_box box_2">
		 	<h3>单位级别数量统计</h3>
		 	<div id="jbshul" style="height: 265px;"></div>
		 	<span class="kk1"></span>
		 	<span class="kk2"></span>
		 </div>
		  <div class="tb_box tb_box3 box_3">
		 	<h3 style="width: 312px;">保安公司数量统计</h3>
		 	<div id="xzshul" style="width: 320px; height: 265px;"></div>
		 </div>
		  <div class="tb_box tb_box2 box_4">
		 	<h3 style="width: 362px;">保卫人员数量统计</h3>
		 	<div id="bwshul" style="width: 370px; height: 265px;"></div>
		 </div>
		  <div class="tb_box tb_box2 box_5">
		 	<h3 style="width: 362px;">重点部位数量统计</h3>
		 	<div id="zdbwshul" style="width: 370px; height: 265px;"></div>
		 </div>
		   <div class="tb_box tb_box2 box_6">
		 	<h3 style="width: 362px;">重点岗位人员数量统计</h3>
		 	<div id="zdwwshul" style="width: 370px; height: 265px;"></div>
		 </div>
		  <div class="tb_box tb_box3 box_7">
		 	<h3 style="width: 312px;">单位状态数量统计</h3>
		 	<div id="zdztshul" style="width: 320px; height: 265px;"></div>
		 </div>
		  <div class="tb_box box_8">
		 	<h3>行业类别数量统计</h3>
		 	<div id="hylbul" style="height: 265px;"></div>
		 	<span class="kk1"></span>
		 	<span class="kk2"></span>
		 </div>
		   <div class="tb_box box_9">
		 	<h3>行业管控系统数量统计</h3>
		 	<div id="huizong" style="height: 265px;"></div>
		 	<span class="kk1"></span>
		 	<span class="kk2"></span>
		 </div>
	</div>
</body>
</html>

<div class="modal" style="display: none;"></div>
<div class="tk" style="display: none;">
	<div class="tk_tit">
		<h3>提示</h3>
		<b class="tk_close" >x</b>
	</div>
	<div class="table">
		<p class='tishi'>没有数据!</p>
		<button class='close'>确定</button>
	</div>
</div>


<script type="text/javascript">
	
	// var allmap = echarts.init(document.getElementById('allmap'));
       $(function(){
       		
	   		
	   		
	   		$(".tk_close").click(function(){
	   			popHide();
	   		});
	   		$(".close").click(function(){
	   			popHide();
	   		});
	   		
	   		function popHide(){
	   			$(".tk").hide();
	   			$(".modal").hide();
	   		}
        })
   		
   		
   		
   		//时间
            $(function(){
            	
            setInterval(function() {

            var now_time = new Date();
                    var year = now_time.getFullYear();
                    var month = now_time.getMonth() + 1;
                    var dates = now_time.getDate();
                    var hours = now_time.getHours();
                    var minu = now_time.getMinutes();
                    var seco = now_time.getSeconds();
                    var today = now_time.getDay();
                    if (hours < 10){
            hours = '0' + hours;
            }
            if (minu < 10){
            minu = '0' + minu;
            }
            if (seco < 10){
            seco = '0' + seco;
            }
            if (today == 1){
            today = '星期一';
            } else if (today == 2){
            today = '星期二';
            } else if (today == 3){
            today = '星期三';
            } else if (today == 4){
            today = '星期四';
            } else if (today == 5){
            today = '星期五';
            } else if (today == 6){
            today = '星期六';
            } else if (today == 0){
            today = '星期日';
            }
            $('#hours').html(hours + ':' + minu + ':' + seco);
            $('#year').html(year + '年' + month + '月' + dates + '日');
            $('#today').html(today);
            }, 1000);
			})
   
   	$("#back").click(function(){
   			city_n = 0;
    		myChart.clear();
    		load_map_data('湖北省');
			dwshul('湖北省');
			jbshul_fn('湖北省');
			zdbwshul_fn('湖北省');
			bwshul_fn('湖北省');
			zdwwshul_fn('湖北省');
			zdztshul_fn("湖北省");
			hylbul_fn("湖北省");
			xzshul_fn('湖北省');
			huizong_fn('湖北省');
    	})

    // 全省地图数据
		var hubei_data = [
							{city:'湖北省', map_name:'HB', map:'{{ URL::asset("/") }}big/map_data/hubei.json'},
							{city:'武汉市', map_name:'WH', map:'{{ URL::asset("/") }}big/map_data/wuhan.json'},
							{city:'荆州市', map_name:'JZ', map:'{{ URL::asset("/") }}big/map_data/jingzhou.json'},
							{city:'恩施土家族苗族自治州', map_name:'ES', map:'{{ URL::asset("/") }}big/map_data/enshi.json'},
							{city:'鄂州市', map_name:'EZ', map:'{{ URL::asset("/") }}big/map_data/ezhou.json'},
							{city:'黄冈市', map_name:'HG', map:'{{ URL::asset("/") }}big/map_data/huanggang.json'},
							{city:'黄石市', map_name:'HS', map:'{{ URL::asset("/") }}big/map_data/huangshi.json'},
							{city:'荆门市', map_name:'JM', map:'{{ URL::asset("/") }}big/map_data/jingmen.json'},
							{city:'十堰市', map_name:'SY', map:'{{ URL::asset("/") }}big/map_data/shiyan.json'},
							{city:'随州市', map_name:'SZ', map:'{{ URL::asset("/") }}big/map_data/suizhou.json'},
							{city:'襄阳市', map_name:'XY', map:'{{ URL::asset("/") }}big/map_data/xiangyang.json'},
							{city:'咸宁市', map_name:'XN', map:'{{ URL::asset("/") }}big/map_data/xianning.json'},
							{city:'孝感市', map_name:'XG', map:'{{ URL::asset("/") }}big/map_data/xiaogan.json'},
							{city:'宜昌市', map_name:'YC', map:'{{ URL::asset("/") }}big/map_data/yichang.json'},
							{city:'神农架林区', map_name:'SNJ', map:'{{ URL::asset("/") }}big/map_data/shennongjia.json'},
							{city:'潜江市', map_name:'QJ', map:'{{ URL::asset("/") }}big/map_data/qianjiang.json'},
							{city:'天门市', map_name:'TM', map:'{{ URL::asset("/") }}big/map_data/tianmen.json'},
							{city:'仙桃市', map_name:'TM', map:'{{ URL::asset("/") }}big/map_data/xiantao.json'},
						];

		// 地图加载数据，默认未加载任何数据
		var map_load = [];

		// 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('allmap'));

		// 当前地图数据
		var uploadedDataURL = "{{ URL::asset('/') }}big/map_data/hubei.json";
		var city_n = 0;
		// 定义单击事件
		var shen = '';
		var shen1 = '';
		
		var zuojiaKaiguan = true;
		myChart.on('click', function (params) {
			city_n++;
			console.log(params);
			load_map_data(params.name);
			
			
			function city2(){
				if(params.name == "恩施土家族苗族自治州"){
					params.name = "恩施州";
				}else 
				if(params.name == "神农架林区"){
					params.name = "神农架";
				}
			}
			if(city_n==1){
				city2();
				shen ="湖北省";
				shen1 = params.name;
				setTimeout(function(){
					shen = shen1;
				},1000)
			}else if(city_n>1){
				
				city2();
				if(params.name == ''){
					shen1 = '空';
					popShow();
					function popShow(){
		   				$(".tk").show();
		   				$(".modal").show();
		   			}
					
				}else{
					shen1 = params.name;
				}
				
			}
			
			dwshul(shen,shen1);
			jbshul_fn(shen,shen1);
			zdbwshul_fn(shen,shen1);
			bwshul_fn(shen,shen1);
			zdwwshul_fn(shen,shen1);
			zdztshul_fn(shen,shen1);
			hylbul_fn(shen,shen1);
			xzshul_fn(shen,shen1);
			huizong_fn(shen,shen1);
			console.log(shen,shen1)
			
//			xqTable();
//			var city = ["武汉市","十堰市","襄阳市","荆门市","孝感市","黄冈市","鄂州市","黄石市","咸宁市","荆州市","宜昌市","随州市","仙桃市","天门市","潜江市","神农架","恩施州"]
//			$.each(city, function() {
//				var n = 0;
//				if(this == params.name){}else{n++;};
//				if(n==city.length){
//					
//				}
//			});
			
			function xqTable(){
				$(".modal").show();
				$(".tk").show();
			}
		});
		
		// 找到地图数据
		function get_map_data(name){
			console.log(name);
			for (i = 0; i < hubei_data.length; i++)
			{
				if (hubei_data[i].city == name)
				{
					return hubei_data[i];
				}
			}
		}
		
		// 加载地图数据
		function load_map_data(name)
		{
			console.log(name);
			var cityname = '';
			cityname = name;
			var map = get_map_data(name);
			if (map == null){
				console.log('no map data');
			} else {
				uploadedDataURL = map.map;
				if(cityname == "湖北省"){
					cityname = "1";
				}else if(cityname == "恩施土家族苗族自治州"){
					cityname = "恩施州";
				}else if(cityname == "神农架林区"){
					cityname = "神农架";
				}
				$.ajax({
					type:"POST",
					url:"{{url('admin/Earth/tjdw')}}",
					data: {'name':cityname, '_token':'{{csrf_token()}}'},
					async:true,
					success:function(data){
						var obj = jQuery.parseJSON(data)
						console.log(obj);
						data_arr = obj.result;
						console.log(data_arr);
						 for(var i = 0;i<data_arr.length;i++){
						 	 if(data_arr[i].name == "神农架"){
						 	 	data_arr[i].name = "神农架林区"
						 	 }else if(data_arr[i].name == "恩施州"){
						 	 	data_arr[i].name = "恩施土家族苗族自治州"
						 	 }
						 }	
						 console.log(data_arr);			
            		// data 为城市的数据
    				//data_arr = [{name: '武汉市', value: 20057.34}, {name: '荆州市', value: 15477.48}];
    				load_chart(map, data_arr);
					}
				});
			}
		}

		function load_chart(map){
			// 最好写入过滤的方法，不要重复加载地图
			$.getJSON(uploadedDataURL, function (geoJson) {

				myChart.hideLoading();

				echarts.registerMap(map.map_name, geoJson);

				myChart.setOption(option = {
					title: {
						text: map.city + '数据',
						textStyle:{
							color:'#fff'
						}
//						subtext: '内保企业数据',
//						sublink: 'http://nb.yntosite.com'
					},
					tooltip: {
						trigger: 'item',
						formatter:function(map){
							for(var k in map.data){
								if(k == 'value'){
									return  map.value;
								}
							}
							return 0;
						}
					},
					toolbox: {
						show: false,
						orient: 'vertical',
						left: 'right',
						top: 'center',
						feature: {
							dataView: {readOnly: false},
							restore: {},
							saveAsImage: {}
						}
					},
					visualMap: {
						min: 800,
						max: 50000,
						text:['High','Low'],
						realtime: false,
						calculable: true,
//						color: ['orangered','yellow','lightskyblue']
						color: ['red','#4ad1ff','lightskyblue']
					},
					series: [
						{
							name: map.city,
							type: 'map',
							mapType: map.map_name, // 自定义扩展图表类型
							label:{
								normal:{
									textStyle:{color:"#fff"}//省份标签字体颜色
								}
							},
							itemStyle:{
								normal:{
									label:{show:true},
									borderColor: '#00bbec',//区域边框颜色
									areaColor:"transparent"//区域颜色
								},
								emphasis:{label:{show:true}}
							},
							data:data_arr
						}
					]
				});
			});
		}

		
		// 开始加载湖北地图
	
//	 	 load_map_data('湖北省');
		function morenCity(){
			$.ajax({
        	 	type:"POST",
        	 	url:"{{url('admin/bigapi/getmap')}}",
        	 	async:true,
        	 	data: {'_token':'{{csrf_token()}}'},
        	    dateType: 'json',
        	    success : function(data){
        	    	var obj = {};
        	        var obj = jQuery.parseJSON(data);
					console.log(obj);   
					if(obj.city == 'no'){
						load_map_data('湖北省');
					}else{
						load_map_data(obj.city);    
					}
        	    }
        	 });
		}
		morenCity();
		
		
		dwshul('湖北省');
         function dwshul(name1,name2){
         	$.ajax({
        	 	type:"POST",
        	 	url:"{{url('admin/bigapi/getunit')}}",
        	 	async:true,
        	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
        	    dateType: 'json',
        	    success : function(data){
        	    	var obj = {};
        	        var obj = jQuery.parseJSON(data);
        	        tubiao1(obj.city);
        	        
        	    }
        	   
        	 });
         }
     
  
 var shul = echarts.init(document.getElementById('shul'));
 
 
 function tubiao1(datas){

 shul_option = {
    backgroundColor: 'transparent',

    title: {
//      text: 'Customized Pie',
        left: 'center',
        top: 20,
        textStyle: {
            color: '#ccc'
        }
    },
//	color:['red','yellow']
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },

//  visualMap: {
//      show: false,
//      min: 80,
//      max: 600,
//      inRange: {
//          colorLightness: [0, 1]
//      }
//  },
    series : [
        {
            name:'单位数量',
            type:'pie',
            radius : '55%',
            center: ['50%', '50%'],
            data:datas.sort(function (a, b) { return a.value - b.value; }),
            roseType: 'radius',
            label: {
                normal: {
                    textStyle: {
                        color: 'rgba(255, 255, 255, 0.3)'
                    }
                }
            },
            labelLine: {
                normal: {
                    lineStyle: {
                        color: 'rgba(255, 255, 255, 0.3)'
                    },
                    smooth: 0.2,
                    length: 10,
                    length2: 20
                }
            },
            color: ['#1b56ea','#f24949', '#4ddade'],
            itemStyle: {
                normal: {
                    color: '',
                    shadowBlur: 200,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            },

            animationType: 'scale',
            animationEasing: 'elasticOut',
            animationDelay: function (idx) {
                return Math.random() * 200;
            }
        }
    ]
	}
 
// 使用刚指定的配置项和数据显示图表。
        shul.setOption(shul_option);	 
}
   
   
// 单位级别数量统计          
var jbshul = echarts.init(document.getElementById('jbshul'));
jbshul_fn("湖北省");
function jbshul_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/getdwjib')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
    	        if(obj.city[0].length == 0){
    	        	jbshul.clear();
    	        }else{
    	        	  tubiao2(obj.city[0]);
    	        }
    	    }
    	   
    	 });
 }
    
  function tubiao2_jian(data){
  	var data1 = [];
	for(x in data){
		data1.push(x);
	}
  	return data1;
  }
   function tubiao2_jian1(data){
  	var data2 = [];
	for(x in data){
		data2.push(data[x]);
	}
  	return data2;
  }
 function tubiao2(data){
 	jbshul_option = {
    color: ['#3398DB'],
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : tubiao2_jian(data),
            axisTick: {
                alignWithLabel: true
            },
             axisLabel: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        }
        }
    ],
    yAxis : [
        {
            type : 'value',
            axisLabel: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        }
        }
    ],
    series : [
        {
            name:'数量',
            type:'bar',
            barWidth: '60%',
            data:tubiao2_jian1(data),
	        itemStyle:{
	                        normal:{
	                            color:'#ceee61'
	                        }
	                    }
        }
    ]
};
// 使用刚指定的配置项和数据显示图表。
        jbshul.setOption(jbshul_option);	
 }


 
        
// 保安公司数量统计       
var xzshul = echarts.init(document.getElementById('xzshul'));

xzshul_fn('湖北省');
function xzshul_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/bags')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
    	        console.log(tubiao3_jian(obj.city));
    	       
    	         if(obj.city.length == 0){
    	        	xzshul.clear();
    	        }else{
	        	     tubiao3(obj.city[0],obj.city);
    	        }
    	    }
    	   
    	 });
 }
  function tubiao3_jian(data){
  	var data1 = [];
  	for(var i = 0 ;i<data.length;i++){
  		for(x in data[i]){
			if(x == 'name'){
				data1.push(data[i].name);
			}
		}
  	}
	 return data1;
}
	
function tubiao3(daTa,data){
//option
xzshul_option = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    color:['#ac7921','#91c7ae', '#d48265','#61a0a8'],
    legend: {
        orient: 'vertical',
        x: 'left',
        data:tubiao3_jian(data),
        textStyle:{
        	color:"#fff"
        }
    },
    series: [
        {
            name:'保安公司数量',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '16',
                        fontWeight: 'bold',
                        color:'#fff'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[daTa],
        }
    ]
};
// 使用刚指定的配置项和数据显示图表。
        xzshul.setOption(xzshul_option);
}


        
//保卫人员数量统计
var bwshul = echarts.init(document.getElementById('bwshul'));
bwshul_fn('湖北省');
function bwshul_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/getbwry')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
    	        tubiao4(obj.city);
    	    }
    	   
    	 });
 }
 function tubiao4_jian(data){
	var data1 = [];
	for(var i = 0;i<data.length;i++){
		data1.push(data[i].name);
	}
	return data1;
}
function tubiao4_jian1(data){
	var data2 = [];
	for(var i = 0;i<data.length;i++){
		data2.push(data[i].value);
	}
	return data2;
}
function tubiao4(data){
	bwshul_option = {
   
    tooltip : {
        trigger: 'axis',
        axisPointer: {
            type: 'cross',
            label: {
                backgroundColor: 'transparent'
            }
        }
    },
    legend: {
        data:['保卫人员数量'],
        textStyle:{    //图例文字的样式
	        color:'#fff',
	    }
    },
    toolbox: {
    	show:false,
        feature: {
            saveAsImage: {}
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'value',
            boundaryGap : false,
             axisLabel: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        }
        }
    ],
    yAxis : [
        {
            type : 'category',
            data : tubiao4_jian(data),
             axisLabel: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        }
        }
    ],
    series : [
        {
            name:'保卫人员数量',
            type:'line',
            stack: '总量',
            areaStyle: {normal: {}},
            data:tubiao4_jian1(data)
        },
       
      
       
    ]
};

// 使用刚指定的配置项和数据显示图表。
        bwshul.setOption(bwshul_option);
}

        
//重点部位数量统计
var zdbwshul = echarts.init(document.getElementById('zdbwshul'));
zdbwshul_fn('湖北省');
function zdbwshul_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/getzdbw')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
    	        if(obj.city.length == 0){
    	        	zdbwshul.clear();
    	        }else{
    	        	 tubiao5(obj.city)
    	        }
    	    }
    	   
    	 });
 }
function tubiao5_jian(data){
	var data1 = [];
	for(var i = 0;i<data.length;i++){
		data1.push(data[i].name);
	}
	return data1;
}
function tubiao5_jian1(data){
	var data2 = [];
	for(var i = 0;i<data.length;i++){
		data2.push(data[i].value);
	}
	return data2;
}
function tubiao5(data){
	zdbwshul_option = {
    color: ['#3398DB'],
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : tubiao5_jian(data),
            axisTick: {
                alignWithLabel: true,
            },
              axisLabel: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        }
        }
    ],
    yAxis : [
        {
            type : 'value',
	          axisLabel: {
	                        show: true,
	                        textStyle: {
	                            color: '#fff'
	                        }
	                   },
        }
    ],
    series : [
        {
            name:'重点部位数量',
            type:'bar',
            barWidth: '20%',
            data:tubiao5_jian1(data),
            itemStyle:{
                        normal:{
                            color:'#4cccee'
                        }
                    }
        }
    ]
};

// 使用刚指定的配置项和数据显示图表。
        zdbwshul.setOption(zdbwshul_option);
}

        
//重点岗位人员数量统计
var zdwwshul = echarts.init(document.getElementById('zdwwshul'));
zdwwshul_fn('湖北省');
function zdwwshul_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/getzdry')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
    	         if(obj.city.length == 0){
    	        	zdwwshul.clear();
    	        }else{
	        	    tubiao6(obj.city);
    	        }
    	       
    	    }
    	   
    	 });
 }
 function tubiao6_jian(data){
	var data1 = [];
	for(var i = 0;i<data.length;i++){
		data1.push(data[i].name);
	}
	return data1;
}
function tubiao6_jian1(data){
	var data2 = [];
	for(var i = 0;i<data.length;i++){
		data2.push(data[i].value);
	}
	return data2;
}
function tubiao6(data){
	zdwwshul_option = {
    color: ['#3398DB'],
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : tubiao6_jian(data),
            axisTick: {
                alignWithLabel: true
            },
              axisLabel: {
                            show: true,
                            textStyle: {
                                color: '#fff'
                            }
                        }
        }
    ],
    yAxis : [
        {
            type : 'value',
	          axisLabel: {
	                        show: true,
	                        textStyle: {
	                            color: '#fff'
	                        }
	                   },
        }
    ],
    series : [
        {
            name:'重点岗位人员数量',
            type:'bar',
            barWidth: '20%',
            data:tubiao6_jian1(data),
             itemStyle:{
                        normal:{
                            color:'#f65a24'
                        }
                    }
        }
    ]
};
// 使用刚指定的配置项和数据显示图表。
        zdwwshul.setOption(zdwwshul_option);
}


//单位状态数量统计
var zdztshul = echarts.init(document.getElementById('zdztshul'));
zdztshul_fn("湖北省");
function zdztshul_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/getdwzt')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
    	        console.log(obj.city)
    	           if(obj.city[0].length == 0){
    	        	zdztshul.clear();
    	        }else{
	        	    tubiao7(obj.city[0])
    	        }
    	    }
    	   
    	 });
 }
 function tubiao7_jian(data){
  	var data1 = [];
	for(x in data){
		data1.push({"name":x,"value":data[x]});
	}
  	return data1;
  }
function tubiao7(data){
	zdztshul_option = {
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    color:['#5b55ea', '#72e488','#7beff2','#ceee61'],  
    legend: {
        orient: 'vertical',
        left: 'left',
        data: ['实有','变更','注销'],
        textStyle:{    //图例文字的样式
        	color:'#fff',
    }
    },
    series : [
        {
            name: '单位状态数量',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:tubiao7_jian(data),
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};

// 使用刚指定的配置项和数据显示图表。
        zdztshul.setOption(zdztshul_option);
}

        
//行业类别数量统计
var hylbul = echarts.init(document.getElementById('hylbul'));
hylbul_fn("湖北省");
function hylbul_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/gethylb')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
    	        tubiao8(obj.city[0])
    	           if(obj.city[0].length == 0){
    	        	hylbul.clear();
    	        }else{
	        	    tubiao8(obj.city[0])
    	        }
    	    }
    	   
    	 });
 }
  function tubiao8_jian(data){
  	var data1 = [];
	for(x in data){
		data1.push({"name":x,"value":data[x]});
	}
  	return data1;
  }
  function tubiao8_jian1(data){
  	var data1 = [];
	for(x in data){
		data1.push(x);
	}
  	return data1;
  }
function tubiao8(data){
	hylbul_option = {
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)",
       
    },
    legend: {
        orient: 'vertical',
        left: 'left',
//      data: tubiao8_jian1(data),
        textStyle:{    //图例文字的样式
        	color:'#fff'
    }
    },
    series : [
        {
            name: '行业类别数量',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            label:{
					normal:{
						show:false ,
						position : 'outside'
					},
						emphasis:{
						show :true
					}
				},
				
            data:tubiao8_jian(data),
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
                
            }
        }
    ]
};
// 使用刚指定的配置项和数据显示图表。
        hylbul.setOption(hylbul_option);
}

        
//行业管控数量统计
var huizong = echarts.init(document.getElementById('huizong'));

huizong_fn('湖北省');
function huizong_fn(name1,name2){
     	$.ajax({
    	 	type:"POST",
    	 	url:"{{url('admin/bigapi/hygk')}}",
    	 	async:true,
    	 	data: {'name1':name1,'name2':name2, '_token':'{{csrf_token()}}'},
    	    dateType: 'json',
    	    success : function(data){
    	    	var obj = {};
    	        var obj = jQuery.parseJSON(data);
//  	         console.log(tubiao9_jian(obj));
	            if(obj == 0){
					 huizong.clear();
    	        }else{
	        	    tubiao9(obj);
    	        }
    	    }
    	   
    	 });
 }
  function tubiao9_jian(data){
  	var data1 = [];
	for(x in data){
		data1.push(data[x][0].value);
	}
  	return data1;
  }
function tubiao9(data){
	console.log(data)
	huizong_option = {
    color: ['#3398DB'],
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : ['散装汽油系统', '快递系统', '长途客运系统','保安监管系统'],
            axisTick: {
                alignWithLabel: true
            },
             axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#fff'
                        }
                    }
        }
    ],
    yAxis : [
        {
            type : 'value',
             axisLabel: {
                        show: true,
                        textStyle: {
                            color: '#fff'
                        }
                    }
        }
    ],
    series : [
        {
            name:'数量',
            type:'bar',
            barWidth: '20%',
            data:tubiao9_jian(data),
        }
    ]
};

// 使用刚指定的配置项和数据显示图表。
        huizong.setOption(huizong_option);
}




</script>


